-- Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
--
-- this file licensed under the Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2
--
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
-- PURPOSE.
-- See the Mulan PSL v2 for more details.
--
-- Author: auto generate
-- Create: 2025-7-25
-- Description: DO NOT EDIT; Code generated by "message.lua.mako"
local validate = require 'mc.validate'
local utils = require 'mc.utils'

local MActiveStandbyService = {}

---@class MActiveStandbyService.ActiveMonitorIntervalMS
---@field ActiveMonitorIntervalMS integer
local TActiveMonitorIntervalMS = {}
TActiveMonitorIntervalMS.__index = TActiveMonitorIntervalMS
TActiveMonitorIntervalMS.group = {}

local function TActiveMonitorIntervalMS_from_obj(obj)
    return setmetatable(obj, TActiveMonitorIntervalMS)
end

function TActiveMonitorIntervalMS.new(ActiveMonitorIntervalMS)
    return TActiveMonitorIntervalMS_from_obj({ActiveMonitorIntervalMS = ActiveMonitorIntervalMS})
end
---@param obj MActiveStandbyService.ActiveMonitorIntervalMS
function TActiveMonitorIntervalMS:init_from_obj(obj)
    self.ActiveMonitorIntervalMS = obj.ActiveMonitorIntervalMS
end

function TActiveMonitorIntervalMS:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TActiveMonitorIntervalMS.group)
end

TActiveMonitorIntervalMS.from_obj = TActiveMonitorIntervalMS_from_obj

TActiveMonitorIntervalMS.proto_property = {'ActiveMonitorIntervalMS'}

TActiveMonitorIntervalMS.default = {0}

TActiveMonitorIntervalMS.struct = {{name = 'ActiveMonitorIntervalMS', is_array = false, struct = nil}}

function TActiveMonitorIntervalMS:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'ActiveMonitorIntervalMS', self.ActiveMonitorIntervalMS, 'uint32', false, errs,
        need_convert)

    TActiveMonitorIntervalMS:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TActiveMonitorIntervalMS.proto_property, errs, need_convert)
    return self
end

function TActiveMonitorIntervalMS:unpack(_)
    return self.ActiveMonitorIntervalMS
end

MActiveStandbyService.ActiveMonitorIntervalMS = TActiveMonitorIntervalMS

---@class MActiveStandbyService.HeartbeatTimeoutMS
---@field HeartbeatTimeoutMS integer
local THeartbeatTimeoutMS = {}
THeartbeatTimeoutMS.__index = THeartbeatTimeoutMS
THeartbeatTimeoutMS.group = {}

local function THeartbeatTimeoutMS_from_obj(obj)
    return setmetatable(obj, THeartbeatTimeoutMS)
end

function THeartbeatTimeoutMS.new(HeartbeatTimeoutMS)
    return THeartbeatTimeoutMS_from_obj({HeartbeatTimeoutMS = HeartbeatTimeoutMS or 3000})
end
---@param obj MActiveStandbyService.HeartbeatTimeoutMS
function THeartbeatTimeoutMS:init_from_obj(obj)
    self.HeartbeatTimeoutMS = obj.HeartbeatTimeoutMS or 3000
end

function THeartbeatTimeoutMS:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, THeartbeatTimeoutMS.group)
end

THeartbeatTimeoutMS.from_obj = THeartbeatTimeoutMS_from_obj

THeartbeatTimeoutMS.proto_property = {'HeartbeatTimeoutMS'}

THeartbeatTimeoutMS.default = {0}

THeartbeatTimeoutMS.struct = {{name = 'HeartbeatTimeoutMS', is_array = false, struct = nil}}

function THeartbeatTimeoutMS:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'HeartbeatTimeoutMS', self.HeartbeatTimeoutMS, 'uint32', false, errs, need_convert)

    THeartbeatTimeoutMS:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, THeartbeatTimeoutMS.proto_property, errs, need_convert)
    return self
end

function THeartbeatTimeoutMS:unpack(_)
    return self.HeartbeatTimeoutMS
end

MActiveStandbyService.HeartbeatTimeoutMS = THeartbeatTimeoutMS

---@class MActiveStandbyService.HeartbeatIntervalMS
---@field HeartbeatIntervalMS integer
local THeartbeatIntervalMS = {}
THeartbeatIntervalMS.__index = THeartbeatIntervalMS
THeartbeatIntervalMS.group = {}

local function THeartbeatIntervalMS_from_obj(obj)
    return setmetatable(obj, THeartbeatIntervalMS)
end

function THeartbeatIntervalMS.new(HeartbeatIntervalMS)
    return THeartbeatIntervalMS_from_obj({HeartbeatIntervalMS = HeartbeatIntervalMS or 300})
end
---@param obj MActiveStandbyService.HeartbeatIntervalMS
function THeartbeatIntervalMS:init_from_obj(obj)
    self.HeartbeatIntervalMS = obj.HeartbeatIntervalMS or 300
end

function THeartbeatIntervalMS:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, THeartbeatIntervalMS.group)
end

THeartbeatIntervalMS.from_obj = THeartbeatIntervalMS_from_obj

THeartbeatIntervalMS.proto_property = {'HeartbeatIntervalMS'}

THeartbeatIntervalMS.default = {0}

THeartbeatIntervalMS.struct = {{name = 'HeartbeatIntervalMS', is_array = false, struct = nil}}

function THeartbeatIntervalMS:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'HeartbeatIntervalMS', self.HeartbeatIntervalMS, 'uint32', false, errs, need_convert)

    THeartbeatIntervalMS:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, THeartbeatIntervalMS.proto_property, errs, need_convert)
    return self
end

function THeartbeatIntervalMS:unpack(_)
    return self.HeartbeatIntervalMS
end

MActiveStandbyService.HeartbeatIntervalMS = THeartbeatIntervalMS

---@class MActiveStandbyService.BoardFullySeated
---@field BoardFullySeated integer
local TBoardFullySeated = {}
TBoardFullySeated.__index = TBoardFullySeated
TBoardFullySeated.group = {}

local function TBoardFullySeated_from_obj(obj)
    return setmetatable(obj, TBoardFullySeated)
end

function TBoardFullySeated.new(BoardFullySeated)
    return TBoardFullySeated_from_obj({BoardFullySeated = BoardFullySeated})
end
---@param obj MActiveStandbyService.BoardFullySeated
function TBoardFullySeated:init_from_obj(obj)
    self.BoardFullySeated = obj.BoardFullySeated
end

function TBoardFullySeated:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TBoardFullySeated.group)
end

TBoardFullySeated.from_obj = TBoardFullySeated_from_obj

TBoardFullySeated.proto_property = {'BoardFullySeated'}

TBoardFullySeated.default = {0}

TBoardFullySeated.struct = {{name = 'BoardFullySeated', is_array = false, struct = nil}}

function TBoardFullySeated:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'BoardFullySeated', self.BoardFullySeated, 'uint8', false, errs, need_convert)

    TBoardFullySeated:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TBoardFullySeated.proto_property, errs, need_convert)
    return self
end

function TBoardFullySeated:unpack(_)
    return self.BoardFullySeated
end

MActiveStandbyService.BoardFullySeated = TBoardFullySeated

---@class MActiveStandbyService.ActiveRead
---@field ActiveRead integer
local TActiveRead = {}
TActiveRead.__index = TActiveRead
TActiveRead.group = {}

local function TActiveRead_from_obj(obj)
    return setmetatable(obj, TActiveRead)
end

function TActiveRead.new(ActiveRead)
    return TActiveRead_from_obj({ActiveRead = ActiveRead})
end
---@param obj MActiveStandbyService.ActiveRead
function TActiveRead:init_from_obj(obj)
    self.ActiveRead = obj.ActiveRead
end

function TActiveRead:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TActiveRead.group)
end

TActiveRead.from_obj = TActiveRead_from_obj

TActiveRead.proto_property = {'ActiveRead'}

TActiveRead.default = {0}

TActiveRead.struct = {{name = 'ActiveRead', is_array = false, struct = nil}}

function TActiveRead:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'ActiveRead', self.ActiveRead, 'uint8', false, errs, need_convert)

    TActiveRead:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TActiveRead.proto_property, errs, need_convert)
    return self
end

function TActiveRead:unpack(_)
    return self.ActiveRead
end

MActiveStandbyService.ActiveRead = TActiveRead

---@class MActiveStandbyService.HealthStatus
---@field HealthStatus integer
local THealthStatus = {}
THealthStatus.__index = THealthStatus
THealthStatus.group = {}

local function THealthStatus_from_obj(obj)
    return setmetatable(obj, THealthStatus)
end

function THealthStatus.new(HealthStatus)
    return THealthStatus_from_obj({HealthStatus = HealthStatus})
end
---@param obj MActiveStandbyService.HealthStatus
function THealthStatus:init_from_obj(obj)
    self.HealthStatus = obj.HealthStatus
end

function THealthStatus:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, THealthStatus.group)
end

THealthStatus.from_obj = THealthStatus_from_obj

THealthStatus.proto_property = {'HealthStatus'}

THealthStatus.default = {0}

THealthStatus.struct = {{name = 'HealthStatus', is_array = false, struct = nil}}

function THealthStatus:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'HealthStatus', self.HealthStatus, 'uint8', false, errs, need_convert)

    THealthStatus:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, THealthStatus.proto_property, errs, need_convert)
    return self
end

function THealthStatus:unpack(_)
    return self.HealthStatus
end

MActiveStandbyService.HealthStatus = THealthStatus

---@class MActiveStandbyService.HeartbeatWrite
---@field HeartbeatWrite integer
local THeartbeatWrite = {}
THeartbeatWrite.__index = THeartbeatWrite
THeartbeatWrite.group = {}

local function THeartbeatWrite_from_obj(obj)
    return setmetatable(obj, THeartbeatWrite)
end

function THeartbeatWrite.new(HeartbeatWrite)
    return THeartbeatWrite_from_obj({HeartbeatWrite = HeartbeatWrite})
end
---@param obj MActiveStandbyService.HeartbeatWrite
function THeartbeatWrite:init_from_obj(obj)
    self.HeartbeatWrite = obj.HeartbeatWrite
end

function THeartbeatWrite:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, THeartbeatWrite.group)
end

THeartbeatWrite.from_obj = THeartbeatWrite_from_obj

THeartbeatWrite.proto_property = {'HeartbeatWrite'}

THeartbeatWrite.default = {0}

THeartbeatWrite.struct = {{name = 'HeartbeatWrite', is_array = false, struct = nil}}

function THeartbeatWrite:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'HeartbeatWrite', self.HeartbeatWrite, 'uint8', false, errs, need_convert)

    THeartbeatWrite:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, THeartbeatWrite.proto_property, errs, need_convert)
    return self
end

function THeartbeatWrite:unpack(_)
    return self.HeartbeatWrite
end

MActiveStandbyService.HeartbeatWrite = THeartbeatWrite

---@class MActiveStandbyService.ActiveToStandbyWriteProtect
---@field ActiveToStandbyWriteProtect integer
local TActiveToStandbyWriteProtect = {}
TActiveToStandbyWriteProtect.__index = TActiveToStandbyWriteProtect
TActiveToStandbyWriteProtect.group = {}

local function TActiveToStandbyWriteProtect_from_obj(obj)
    return setmetatable(obj, TActiveToStandbyWriteProtect)
end

function TActiveToStandbyWriteProtect.new(ActiveToStandbyWriteProtect)
    return TActiveToStandbyWriteProtect_from_obj({ActiveToStandbyWriteProtect = ActiveToStandbyWriteProtect})
end
---@param obj MActiveStandbyService.ActiveToStandbyWriteProtect
function TActiveToStandbyWriteProtect:init_from_obj(obj)
    self.ActiveToStandbyWriteProtect = obj.ActiveToStandbyWriteProtect
end

function TActiveToStandbyWriteProtect:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TActiveToStandbyWriteProtect.group)
end

TActiveToStandbyWriteProtect.from_obj = TActiveToStandbyWriteProtect_from_obj

TActiveToStandbyWriteProtect.proto_property = {'ActiveToStandbyWriteProtect'}

TActiveToStandbyWriteProtect.default = {0}

TActiveToStandbyWriteProtect.struct = {{name = 'ActiveToStandbyWriteProtect', is_array = false, struct = nil}}

function TActiveToStandbyWriteProtect:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'ActiveToStandbyWriteProtect', self.ActiveToStandbyWriteProtect, 'uint8', false, errs,
        need_convert)

    TActiveToStandbyWriteProtect:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TActiveToStandbyWriteProtect.proto_property, errs, need_convert)
    return self
end

function TActiveToStandbyWriteProtect:unpack(_)
    return self.ActiveToStandbyWriteProtect
end

MActiveStandbyService.ActiveToStandbyWriteProtect = TActiveToStandbyWriteProtect

---@class MActiveStandbyService.StandbyToActiveWriteProtect
---@field StandbyToActiveWriteProtect integer
local TStandbyToActiveWriteProtect = {}
TStandbyToActiveWriteProtect.__index = TStandbyToActiveWriteProtect
TStandbyToActiveWriteProtect.group = {}

local function TStandbyToActiveWriteProtect_from_obj(obj)
    return setmetatable(obj, TStandbyToActiveWriteProtect)
end

function TStandbyToActiveWriteProtect.new(StandbyToActiveWriteProtect)
    return TStandbyToActiveWriteProtect_from_obj({StandbyToActiveWriteProtect = StandbyToActiveWriteProtect})
end
---@param obj MActiveStandbyService.StandbyToActiveWriteProtect
function TStandbyToActiveWriteProtect:init_from_obj(obj)
    self.StandbyToActiveWriteProtect = obj.StandbyToActiveWriteProtect
end

function TStandbyToActiveWriteProtect:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TStandbyToActiveWriteProtect.group)
end

TStandbyToActiveWriteProtect.from_obj = TStandbyToActiveWriteProtect_from_obj

TStandbyToActiveWriteProtect.proto_property = {'StandbyToActiveWriteProtect'}

TStandbyToActiveWriteProtect.default = {0}

TStandbyToActiveWriteProtect.struct = {{name = 'StandbyToActiveWriteProtect', is_array = false, struct = nil}}

function TStandbyToActiveWriteProtect:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'StandbyToActiveWriteProtect', self.StandbyToActiveWriteProtect, 'uint8', false, errs,
        need_convert)

    TStandbyToActiveWriteProtect:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TStandbyToActiveWriteProtect.proto_property, errs, need_convert)
    return self
end

function TStandbyToActiveWriteProtect:unpack(_)
    return self.StandbyToActiveWriteProtect
end

MActiveStandbyService.StandbyToActiveWriteProtect = TStandbyToActiveWriteProtect

---@class MActiveStandbyService.ActiveToStandbyWrite
---@field ActiveToStandbyWrite integer
local TActiveToStandbyWrite = {}
TActiveToStandbyWrite.__index = TActiveToStandbyWrite
TActiveToStandbyWrite.group = {}

local function TActiveToStandbyWrite_from_obj(obj)
    return setmetatable(obj, TActiveToStandbyWrite)
end

function TActiveToStandbyWrite.new(ActiveToStandbyWrite)
    return TActiveToStandbyWrite_from_obj({ActiveToStandbyWrite = ActiveToStandbyWrite})
end
---@param obj MActiveStandbyService.ActiveToStandbyWrite
function TActiveToStandbyWrite:init_from_obj(obj)
    self.ActiveToStandbyWrite = obj.ActiveToStandbyWrite
end

function TActiveToStandbyWrite:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TActiveToStandbyWrite.group)
end

TActiveToStandbyWrite.from_obj = TActiveToStandbyWrite_from_obj

TActiveToStandbyWrite.proto_property = {'ActiveToStandbyWrite'}

TActiveToStandbyWrite.default = {0}

TActiveToStandbyWrite.struct = {{name = 'ActiveToStandbyWrite', is_array = false, struct = nil}}

function TActiveToStandbyWrite:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'ActiveToStandbyWrite', self.ActiveToStandbyWrite, 'uint8', false, errs, need_convert)

    TActiveToStandbyWrite:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TActiveToStandbyWrite.proto_property, errs, need_convert)
    return self
end

function TActiveToStandbyWrite:unpack(_)
    return self.ActiveToStandbyWrite
end

MActiveStandbyService.ActiveToStandbyWrite = TActiveToStandbyWrite

---@class MActiveStandbyService.StandbyToActiveWrite
---@field StandbyToActiveWrite integer
local TStandbyToActiveWrite = {}
TStandbyToActiveWrite.__index = TStandbyToActiveWrite
TStandbyToActiveWrite.group = {}

local function TStandbyToActiveWrite_from_obj(obj)
    return setmetatable(obj, TStandbyToActiveWrite)
end

function TStandbyToActiveWrite.new(StandbyToActiveWrite)
    return TStandbyToActiveWrite_from_obj({StandbyToActiveWrite = StandbyToActiveWrite})
end
---@param obj MActiveStandbyService.StandbyToActiveWrite
function TStandbyToActiveWrite:init_from_obj(obj)
    self.StandbyToActiveWrite = obj.StandbyToActiveWrite
end

function TStandbyToActiveWrite:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TStandbyToActiveWrite.group)
end

TStandbyToActiveWrite.from_obj = TStandbyToActiveWrite_from_obj

TStandbyToActiveWrite.proto_property = {'StandbyToActiveWrite'}

TStandbyToActiveWrite.default = {0}

TStandbyToActiveWrite.struct = {{name = 'StandbyToActiveWrite', is_array = false, struct = nil}}

function TStandbyToActiveWrite:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'StandbyToActiveWrite', self.StandbyToActiveWrite, 'uint8', false, errs, need_convert)

    TStandbyToActiveWrite:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TStandbyToActiveWrite.proto_property, errs, need_convert)
    return self
end

function TStandbyToActiveWrite:unpack(_)
    return self.StandbyToActiveWrite
end

MActiveStandbyService.StandbyToActiveWrite = TStandbyToActiveWrite

---@class MActiveStandbyService.DefaultActiveId
---@field DefaultActiveId integer
local TDefaultActiveId = {}
TDefaultActiveId.__index = TDefaultActiveId
TDefaultActiveId.group = {}

local function TDefaultActiveId_from_obj(obj)
    return setmetatable(obj, TDefaultActiveId)
end

function TDefaultActiveId.new(DefaultActiveId)
    return TDefaultActiveId_from_obj({DefaultActiveId = DefaultActiveId or 1})
end
---@param obj MActiveStandbyService.DefaultActiveId
function TDefaultActiveId:init_from_obj(obj)
    self.DefaultActiveId = obj.DefaultActiveId or 1
end

function TDefaultActiveId:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TDefaultActiveId.group)
end

TDefaultActiveId.from_obj = TDefaultActiveId_from_obj

TDefaultActiveId.proto_property = {'DefaultActiveId'}

TDefaultActiveId.default = {0}

TDefaultActiveId.struct = {{name = 'DefaultActiveId', is_array = false, struct = nil}}

function TDefaultActiveId:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'DefaultActiveId', self.DefaultActiveId, 'uint8', false, errs, need_convert)

    TDefaultActiveId:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TDefaultActiveId.proto_property, errs, need_convert)
    return self
end

function TDefaultActiveId:unpack(_)
    return self.DefaultActiveId
end

MActiveStandbyService.DefaultActiveId = TDefaultActiveId

return MActiveStandbyService
